<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow-IPC: ipc::transport::struc::shm::Capnp_message_builder&lt; Shm_arena &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow-IPC<span id="projectnumber">&#160;1.0.2</span>
   </div>
   <div id="projectbrief">Flow-IPC project: Public API.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceipc.html">ipc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport.html">transport</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport_1_1struc.html">struc</a></li><li class="navelem"><a class="el" href="namespaceipc_1_1transport_1_1struc_1_1shm.html">shm</a></li><li class="navelem"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">Capnp_message_builder</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#related">Related Functions</a> &#124;
<a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">ipc::transport::struc::shm::Capnp_message_builder&lt; Shm_arena &gt; Class Template Reference</div></div>
</div><!--header-->
<div class="contents">

<p>A <code>capnp::MessageBuilder</code> used by <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Builder.html" title="Implements Struct_builder concept with maximal zero-copy perf by (1) storing the actual user-schema-c...">shm::Builder</a>: similar to a <code>MallocMessageBuilder</code> with the <code>GROW_HEURISTICALLY</code> alloc-strategy but allocating via a SHM provider (of template-arg-specific type) in SHM instead of the heap via <code>malloc()</code>.  
 <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#details">More...</a></p>

<p><code>#include &lt;capnp_msg_builder.hpp&gt;</code></p>

<p>Inherits Capnp_msg_builder_interface, and flow::log::Log_context.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ad96e79475a2bccc0c7186da577b61a38"><td class="memItemLeft" align="right" valign="top"><a id="ad96e79475a2bccc0c7186da577b61a38" name="ad96e79475a2bccc0c7186da577b61a38"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>Arena</b> = Shm_arena</td></tr>
<tr class="memdesc:ad96e79475a2bccc0c7186da577b61a38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Short-hand for, you know. <br /></td></tr>
<tr class="separator:ad96e79475a2bccc0c7186da577b61a38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac24a769b13a6c501709a5eb1a574a503"><td class="memTemplParams" colspan="2"><a id="ac24a769b13a6c501709a5eb1a574a503" name="ac24a769b13a6c501709a5eb1a574a503"></a>
template&lt;typename T &gt; </td></tr>
<tr class="memitem:ac24a769b13a6c501709a5eb1a574a503"><td class="memTemplItemLeft" align="right" valign="top">using&#160;</td><td class="memTemplItemRight" valign="bottom"><b>Allocator</b> = <a class="el" href="classipc_1_1shm_1_1stl_1_1Stateless__allocator.html">ipc::shm::stl::Stateless_allocator</a>&lt; T, <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38">Arena</a> &gt;</td></tr>
<tr class="memdesc:ac24a769b13a6c501709a5eb1a574a503"><td class="mdescLeft">&#160;</td><td class="mdescRight">Short-hand for the SHM-aware allocator used in our central data structure holding the capnp serialization. <br /></td></tr>
<tr class="separator:ac24a769b13a6c501709a5eb1a574a503"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a151f03b066fd5fe0c4dfbf97e5fd57dc"><td class="memTemplParams" colspan="2">template&lt;typename T &gt; </td></tr>
<tr class="memitem:a151f03b066fd5fe0c4dfbf97e5fd57dc"><td class="memTemplItemLeft" align="right" valign="top">using&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc">Borrower_allocator</a> = <a class="el" href="classipc_1_1shm_1_1stl_1_1Stateless__allocator.html">ipc::shm::stl::Stateless_allocator</a>&lt; T, <a class="el" href="namespaceipc_1_1shm.html#a6c8474d5b7dda220ed1f6693fc2e3c89">ipc::shm::Arena_to_borrower_allocator_arena_t</a>&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38">Arena</a> &gt; &gt;</td></tr>
<tr class="memdesc:a151f03b066fd5fe0c4dfbf97e5fd57dc"><td class="mdescLeft">&#160;</td><td class="mdescRight">For easier outside generic programming, this is the read-only-borrower counterpart to <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503" title="Short-hand for the SHM-aware allocator used in our central data structure holding the capnp serializa...">Allocator</a>.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc">More...</a><br /></td></tr>
<tr class="separator:a151f03b066fd5fe0c4dfbf97e5fd57dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78c9e811a0cc8105fee37baf5f94929c"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c">Segment_in_shm</a> = flow::util::Basic_blob&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503">Allocator</a>&lt; uint8_t &gt; &gt;</td></tr>
<tr class="memdesc:a78c9e811a0cc8105fee37baf5f94929c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The inner data structure stored in SHM representing one capnp-requested segment storing all or part of the serialization.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c">More...</a><br /></td></tr>
<tr class="separator:a78c9e811a0cc8105fee37baf5f94929c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c7909056d89e83d76ca4555193d3e48"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a3c7909056d89e83d76ca4555193d3e48">Segment_in_shm_borrowed</a> = flow::util::Basic_blob&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc">Borrower_allocator</a>&lt; uint8_t &gt; &gt;</td></tr>
<tr class="memdesc:a3c7909056d89e83d76ca4555193d3e48"><td class="mdescLeft">&#160;</td><td class="mdescRight">For easier outside generic programming, this is the read-only-borrower counterpart to <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c" title="The inner data structure stored in SHM representing one capnp-requested segment storing all or part o...">Segment_in_shm</a>.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a3c7909056d89e83d76ca4555193d3e48">More...</a><br /></td></tr>
<tr class="separator:a3c7909056d89e83d76ca4555193d3e48"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2e22abe941240ffa765bff7d288ce1e"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e">Segments_in_shm</a> = bipc::list&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c">Segment_in_shm</a>, <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503">Allocator</a>&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c">Segment_in_shm</a> &gt; &gt;</td></tr>
<tr class="memdesc:ac2e22abe941240ffa765bff7d288ce1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The outer data structured stored in SHM representing the entire list of capnp-requested segments <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c" title="The inner data structure stored in SHM representing one capnp-requested segment storing all or part o...">Segment_in_shm</a>.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e">More...</a><br /></td></tr>
<tr class="separator:ac2e22abe941240ffa765bff7d288ce1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c04e91665590eb6b80d3ae1931765e8"><td class="memItemLeft" align="right" valign="top">using&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a7c04e91665590eb6b80d3ae1931765e8">Segments_in_shm_borrowed</a> = bipc::list&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a3c7909056d89e83d76ca4555193d3e48">Segment_in_shm_borrowed</a>, <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc">Borrower_allocator</a>&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a3c7909056d89e83d76ca4555193d3e48">Segment_in_shm_borrowed</a> &gt; &gt;</td></tr>
<tr class="memdesc:a7c04e91665590eb6b80d3ae1931765e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">For easier outside generic programming, this is the read-only-borrower counterpart to <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e" title="The outer data structured stored in SHM representing the entire list of capnp-requested segments Segm...">Segments_in_shm</a>: identical but using <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc" title="For easier outside generic programming, this is the read-only-borrower counterpart to Allocator.">Borrower_allocator</a> instead of <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503" title="Short-hand for the SHM-aware allocator used in our central data structure holding the capnp serializa...">Allocator</a>.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a7c04e91665590eb6b80d3ae1931765e8">More...</a><br /></td></tr>
<tr class="separator:a7c04e91665590eb6b80d3ae1931765e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a0c3134a722b160fe2cf87461064db99b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a0c3134a722b160fe2cf87461064db99b">Capnp_message_builder</a> (flow::log::Logger *logger_ptr, <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38">Arena</a> *arena)</td></tr>
<tr class="memdesc:a0c3134a722b160fe2cf87461064db99b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs the message-builder, memorizing the SHM engine it shall use to construct/allocate data internally on-demand via <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a27d819a8373d2706f8c09341601a9cab" title="Implements MessageBuilder API.">allocateSegment()</a> (capnp-invoked from capnp-generated mutator API as invoked by the user).  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a0c3134a722b160fe2cf87461064db99b">More...</a><br /></td></tr>
<tr class="separator:a0c3134a722b160fe2cf87461064db99b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a21d479a863dd80df331b902c7fef16"><td class="memItemLeft" align="right" valign="top"><a id="a3a21d479a863dd80df331b902c7fef16" name="a3a21d479a863dd80df331b902c7fef16"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>~Capnp_message_builder</b> ()</td></tr>
<tr class="memdesc:a3a21d479a863dd80df331b902c7fef16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decrements owner-process count by 1; if current count is 1 deallocates SHM-stored data. <br /></td></tr>
<tr class="separator:a3a21d479a863dd80df331b902c7fef16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a613441302d5735d686adb7d6d92fb0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0">lend</a> (schema::detail::ShmTopSerialization::Builder *capnp_root, <a class="el" href="namespaceipc_1_1session_1_1shm.html#af2acc444cc9664e57df8143b66b78d70">session::shm::Arena_to_shm_session_t</a>&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38">Arena</a> &gt; *shm_session)</td></tr>
<tr class="memdesc:a4a613441302d5735d686adb7d6d92fb0"><td class="mdescLeft">&#160;</td><td class="mdescRight">To be called after being done mutating underlying structured data, increments owner-process count by 1 via <code>shm_session-&gt;lend_object()</code>; and populates a capnp-<code>struct</code> field, saving the encoding of the outer SHM handle to the serialization-segment data structure <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e" title="The outer data structured stored in SHM representing the entire list of capnp-requested segments Segm...">Segments_in_shm</a> into that field.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0">More...</a><br /></td></tr>
<tr class="separator:a4a613441302d5735d686adb7d6d92fb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27d819a8373d2706f8c09341601a9cab"><td class="memItemLeft" align="right" valign="top">kj::ArrayPtr&lt;::capnp::word &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a27d819a8373d2706f8c09341601a9cab">allocateSegment</a> (unsigned int min_sz) override</td></tr>
<tr class="memdesc:a27d819a8373d2706f8c09341601a9cab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implements <code>MessageBuilder</code> API.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a27d819a8373d2706f8c09341601a9cab">More...</a><br /></td></tr>
<tr class="separator:a27d819a8373d2706f8c09341601a9cab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="related" name="related"></a>
Related Functions</h2></td></tr>
<tr><td class="ititle" colspan="2"><p >(Note that these are not member functions.) </p>
</td></tr>
<tr class="memitem:ac4969b49016844f884240b81ee1ab180"><td class="memTemplParams" colspan="2">template&lt;typename Shm_arena &gt; </td></tr>
<tr class="memitem:ac4969b49016844f884240b81ee1ab180"><td class="memTemplItemLeft" align="right" valign="top">std::ostream &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac4969b49016844f884240b81ee1ab180">operator&lt;&lt;</a> (std::ostream &amp;os, const <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">Capnp_message_builder</a>&lt; Shm_arena &gt; &amp;val)</td></tr>
<tr class="memdesc:ac4969b49016844f884240b81ee1ab180"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints string representation of the given <code><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html" title="A capnp::MessageBuilder used by shm::Builder: similar to a MallocMessageBuilder with the GROW_HEURIST...">Capnp_message_builder</a></code> to the given <code>ostream</code>.  <a href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac4969b49016844f884240b81ee1ab180">More...</a><br /></td></tr>
<tr class="separator:ac4969b49016844f884240b81ee1ab180"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename Shm_arena&gt;<br />
class ipc::transport::struc::shm::Capnp_message_builder&lt; Shm_arena &gt;</div><p >A <code>capnp::MessageBuilder</code> used by <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Builder.html" title="Implements Struct_builder concept with maximal zero-copy perf by (1) storing the actual user-schema-c...">shm::Builder</a>: similar to a <code>MallocMessageBuilder</code> with the <code>GROW_HEURISTICALLY</code> alloc-strategy but allocating via a SHM provider (of template-arg-specific type) in SHM instead of the heap via <code>malloc()</code>. </p>
<p >It can also be used as a <a class="el" href="namespaceipc_1_1transport_1_1struc.html#a52405569bf63eaef55f3c2435c885abc" title="Alias for capnp&#39;s MessageBuilder interface. Rationale: as part of our API, we use our identifier styl...">Capnp_msg_builder_interface</a> (<code>capnp::MessageBuilder</code>) independently of the rest of <a class="el" href="namespaceipc_1_1transport_1_1struc.html" title="Sub-module of Flow-IPC module ipc::transport providing transmission of structured messages specifical...">ipc::transport::struc</a> or even <a class="el" href="namespaceipc.html" title="Catch-all namespace for the Flow-IPC project: A library/API in modern C++17 providing high-performanc...">ipc</a>, although that was not the impetus for its development.</p>
<p >Its <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e" title="The outer data structured stored in SHM representing the entire list of capnp-requested segments Segm...">Segments_in_shm</a> type alias is <code>public</code>: <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Reader.html" title="Implements Struct_reader concept by interpreting a serialization by shm::Builder with the same templa...">shm::Reader</a> must know/understand it in order to be able to interpret the SHM-stored data structure.</p>
<p >Contrast this with <a class="el" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder__capnp__message__builder.html" title="A capnp::MessageBuilder used by Heap_fixed_builder: similar to a capnp::MallocMessageBuilder with the...">Heap_fixed_builder_capnp_message_builder</a> which allocates in regular heap. The <code>*this</code>-user-facing output API &ndash; meaning the thing invoked by struc::Builder::emit_serialization() &ndash; is <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0" title="To be called after being done mutating underlying structured data, increments owner-process count by ...">lend()</a>. Cf. <a class="el" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder__capnp__message__builder.html#a478c109e008dd33b04b605278c1b2a54" title="Returns pointers to Blobs which are the serialization segments at this time.">Heap_fixed_builder_capnp_message_builder::emit_segment_blobs()</a>. Why are they so different? Answer:</p><ul>
<li>The latter is meant to emit M segments, each (some) bytes long, to all be transmitted directly over IPC. So it outputs them, to copy into the IPC transport!</li>
<li>We are meant to emit a <em>handle to a data structure storing those M segments</em> to be transmitted directly over IPC. The handle is transmitted; not the entire segments. So it outputs that handle! It just so happens to output it via a capnp mutator call. (It could instead emit a <code>flow::util::Blob</code> and let the caller transmit it however it wants. Why bother though? Just do it. However do see a related to-do in <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0" title="To be called after being done mutating underlying structured data, increments owner-process count by ...">lend()</a> doc header.)</li>
</ul>
<h3>Move-ctible and move-assignable</h3>
<p >Please see similar section in <a class="el" href="classipc_1_1transport_1_1struc_1_1Heap__fixed__builder__capnp__message__builder.html" title="A capnp::MessageBuilder used by Heap_fixed_builder: similar to a capnp::MallocMessageBuilder with the...">Heap_fixed_builder_capnp_message_builder</a> doc header; it applies very similarly to us. Spoiler alert: A move-from involves copying 200+ bytes; consider wrapping <code>*this</code> in a <code>unique_ptr</code> if moving <code>*this</code>.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Shm_arena</td><td>See <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Builder.html" title="Implements Struct_builder concept with maximal zero-copy perf by (1) storing the actual user-schema-c...">shm::Builder</a> doc header, same spot. </td></tr>
  </table>
  </dd>
</dl>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="a151f03b066fd5fe0c4dfbf97e5fd57dc" name="a151f03b066fd5fe0c4dfbf97e5fd57dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a151f03b066fd5fe0c4dfbf97e5fd57dc">&#9670;&nbsp;</a></span>Borrower_allocator</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::Borrower_allocator =  <a class="el" href="classipc_1_1shm_1_1stl_1_1Stateless__allocator.html">ipc::shm::stl::Stateless_allocator</a>&lt;T, <a class="el" href="namespaceipc_1_1shm.html#a6c8474d5b7dda220ed1f6693fc2e3c89">ipc::shm::Arena_to_borrower_allocator_arena_t</a>&lt;<a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38">Arena</a>&gt; &gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For easier outside generic programming, this is the read-only-borrower counterpart to <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503" title="Short-hand for the SHM-aware allocator used in our central data structure holding the capnp serializa...">Allocator</a>. </p>
<p >See also <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a7c04e91665590eb6b80d3ae1931765e8" title="For easier outside generic programming, this is the read-only-borrower counterpart to Segments_in_shm...">Segments_in_shm_borrowed</a>. </p>

</div>
</div>
<a id="a78c9e811a0cc8105fee37baf5f94929c" name="a78c9e811a0cc8105fee37baf5f94929c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78c9e811a0cc8105fee37baf5f94929c">&#9670;&nbsp;</a></span>Segment_in_shm</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::Segment_in_shm =  flow::util::Basic_blob&lt;<a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503">Allocator</a>&lt;uint8_t&gt; &gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The inner data structure stored in SHM representing one capnp-requested segment storing all or part of the serialization. </p>
<p ><code>.capacity()</code> is how much was allocated which is at least what capnp-requested via <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a27d819a8373d2706f8c09341601a9cab" title="Implements MessageBuilder API.">allocateSegment()</a> <code>virtual</code> API we implement. <code>.size()</code> is how many bytes of that were in fact ultimately used by capnp during the <em>last</em> serialization as capped by <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0" title="To be called after being done mutating underlying structured data, increments owner-process count by ...">lend()</a>. If <code>*this</code> is reused, then capnp may write past <code>.size()</code> (but not past <code>.capacity()</code>); <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0" title="To be called after being done mutating underlying structured data, increments owner-process count by ...">lend()</a> will then re-correct <code>.size()</code> to the true segment size used by capnp as reported by <code>this-&gt;getSegmentsForOutput()</code>.</p>
<h3>Choice of container type</h3>
<p >In the past this was, first, <code>std::vector&lt;uint8_t&gt;</code> (which needed <code>Default_init_allocator</code> to avoid 0-filling during <code>.resize()</code> &ndash; see <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0" title="To be called after being done mutating underlying structured data, increments owner-process count by ...">lend()</a>); then <code>bipc::vector&lt;uint8_t&gt;</code> (which needed <code>.resize(n, default_init_t)</code> extension for the same reason ). Then, as intended originally, it became <code>flow::util::Basic_blob&lt;&gt;</code>. Why that over <code>vector&lt;uint8_t&gt;</code>? Answer: <code>Basic_blob</code>'s express purpose is to do just this; some of its main documented aspects (lack of zero-init, iron-clad known perf) are directly counted-upon by us. So we use it for similar reasons as using <code>flow::util::Blob</code> all over the code for such purposes &ndash; maybe even more so.</p>
<p >So really the only thing missing, before we could use it, was its SHM-friendly/custom-allocator support. <code>Blob</code> cannot do it. Once the latter was generalized to <code>Basic_blob&lt;Allocator&gt;</code> we could switch to it, leaving behind a number of rather annoying caveats of the various <code>vector&lt;uint8_t&gt;</code> impls (0-init especially on <code>.resize()</code>, slow destructor on large blobs, and more).</p>
<p >For reasons stated in its doc header <code>Basic_blob</code> does not log in normal fashion (memorizing a <code>Logger*</code> via ctor) but only if supplied an optional <code>Logger*</code> in each particular call. (<code>Blob</code> is a sub-class that adds such functionality at the expense of a bit of RAM/perf, but this is impossible with a custom SHM allocator.) So that's why <code>get_logger()</code> is passed to the few APIs we call on our <code>Basic_blob</code>. </p>

</div>
</div>
<a id="a3c7909056d89e83d76ca4555193d3e48" name="a3c7909056d89e83d76ca4555193d3e48"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3c7909056d89e83d76ca4555193d3e48">&#9670;&nbsp;</a></span>Segment_in_shm_borrowed</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::Segment_in_shm_borrowed =  flow::util::Basic_blob&lt;<a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc">Borrower_allocator</a>&lt;uint8_t&gt; &gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For easier outside generic programming, this is the read-only-borrower counterpart to <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c" title="The inner data structure stored in SHM representing one capnp-requested segment storing all or part o...">Segment_in_shm</a>. </p>
<p >See also <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a7c04e91665590eb6b80d3ae1931765e8" title="For easier outside generic programming, this is the read-only-borrower counterpart to Segments_in_shm...">Segments_in_shm_borrowed</a>. </p>

</div>
</div>
<a id="ac2e22abe941240ffa765bff7d288ce1e" name="ac2e22abe941240ffa765bff7d288ce1e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2e22abe941240ffa765bff7d288ce1e">&#9670;&nbsp;</a></span>Segments_in_shm</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::Segments_in_shm =  bipc::list&lt;<a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c">Segment_in_shm</a>, <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503">Allocator</a>&lt;<a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c">Segment_in_shm</a>&gt; &gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The outer data structured stored in SHM representing the entire list of capnp-requested segments <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a78c9e811a0cc8105fee37baf5f94929c" title="The inner data structure stored in SHM representing one capnp-requested segment storing all or part o...">Segment_in_shm</a>. </p>
<h3>Rationale (<code>bipc::</code> vs <code>std::</code>)</h3>
<p >Why <code>bipc::list</code> and not <code>std::list</code>? Answer: <code>std::list</code>, at least in gcc-8.3.0, gave a compile error fairly clearly implying <code>std::list</code> stores <code>Node*</code> instead of <code>Allocator&lt;Node&gt;::pointer</code>; in other words it is not compatible with SHM (which bipc docs did claim &ndash; but that could easily have been outdated).</p>
<p >Curiously <code>std::vector</code> did not have that problem and worked fine, as far as that went, but we prefer a linked-list here. </p>

</div>
</div>
<a id="a7c04e91665590eb6b80d3ae1931765e8" name="a7c04e91665590eb6b80d3ae1931765e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7c04e91665590eb6b80d3ae1931765e8">&#9670;&nbsp;</a></span>Segments_in_shm_borrowed</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">using <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::Segments_in_shm_borrowed =  bipc::list&lt;<a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a3c7909056d89e83d76ca4555193d3e48">Segment_in_shm_borrowed</a>, <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc">Borrower_allocator</a>&lt;<a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a3c7909056d89e83d76ca4555193d3e48">Segment_in_shm_borrowed</a>&gt; &gt;</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For easier outside generic programming, this is the read-only-borrower counterpart to <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e" title="The outer data structured stored in SHM representing the entire list of capnp-requested segments Segm...">Segments_in_shm</a>: identical but using <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a151f03b066fd5fe0c4dfbf97e5fd57dc" title="For easier outside generic programming, this is the read-only-borrower counterpart to Allocator.">Borrower_allocator</a> instead of <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac24a769b13a6c501709a5eb1a574a503" title="Short-hand for the SHM-aware allocator used in our central data structure holding the capnp serializa...">Allocator</a>. </p>
<p >This type shall be used with <code>borrow_object()</code> on the deserializing side when decoding the <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e" title="The outer data structured stored in SHM representing the entire list of capnp-requested segments Segm...">Segments_in_shm</a> written by a <code>*this</code>. </p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a0c3134a722b160fe2cf87461064db99b" name="a0c3134a722b160fe2cf87461064db99b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c3134a722b160fe2cf87461064db99b">&#9670;&nbsp;</a></span>Capnp_message_builder()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::Capnp_message_builder </td>
          <td>(</td>
          <td class="paramtype">flow::log::Logger *&#160;</td>
          <td class="paramname"><em>logger_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38">Arena</a> *&#160;</td>
          <td class="paramname"><em>arena</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs the message-builder, memorizing the SHM engine it shall use to construct/allocate data internally on-demand via <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a27d819a8373d2706f8c09341601a9cab" title="Implements MessageBuilder API.">allocateSegment()</a> (capnp-invoked from capnp-generated mutator API as invoked by the user). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">logger_ptr</td><td>Logger to use for logging subsequently. </td></tr>
    <tr><td class="paramname">arena</td><td>See <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Builder.html" title="Implements Struct_builder concept with maximal zero-copy perf by (1) storing the actual user-schema-c...">shm::Builder</a> ctor. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a27d819a8373d2706f8c09341601a9cab" name="a27d819a8373d2706f8c09341601a9cab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27d819a8373d2706f8c09341601a9cab">&#9670;&nbsp;</a></span>allocateSegment()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">kj::ArrayPtr&lt;::capnp::word &gt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::allocateSegment </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>min_sz</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Implements <code>MessageBuilder</code> API. </p>
<p >Invoked by capnp, as the user mutates via <code><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Builder.html" title="Implements Struct_builder concept with maximal zero-copy perf by (1) storing the actual user-schema-c...">Builder</a></code>s. Do not invoke directly.</p>
<p >Throws a <code>bad_alloc</code>-like exception if and only if the <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38" title="Short-hand for, you know.">Arena</a> does so when allocating on behalf of the STL-compliant inner code of <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e" title="The outer data structured stored in SHM representing the entire list of capnp-requested segments Segm...">Segments_in_shm</a>.</p>
<dl class="section note"><dt>Note</dt><dd>The strange capitalization (that goes against standard Flow-IPC style) is because we are implementing a capnp API.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">min_sz</td><td>See <code>MessageBuilder</code> API. The allocated segment will allow for a serialization of at <em>least</em> <code>min_sz * sizeof(word)</code> bytes. The actual amount grows progressively similarly to the <code>MallocMessageBuilder</code> GROW_HEURISTICALLY strategy, starting at the same recommended first-segment size as <code>MallocMessageBuilder</code> as well. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>See <code>MessageBuilder</code> API. The ptr and size of the area for capnp to serialize-to. </dd></dl>

</div>
</div>
<a id="a4a613441302d5735d686adb7d6d92fb0" name="a4a613441302d5735d686adb7d6d92fb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a613441302d5735d686adb7d6d92fb0">&#9670;&nbsp;</a></span>lend()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">ipc::transport::struc::shm::Capnp_message_builder</a>&lt; Shm_arena &gt;::lend </td>
          <td>(</td>
          <td class="paramtype">schema::detail::ShmTopSerialization::Builder *&#160;</td>
          <td class="paramname"><em>capnp_root</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="namespaceipc_1_1session_1_1shm.html#af2acc444cc9664e57df8143b66b78d70">session::shm::Arena_to_shm_session_t</a>&lt; <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ad96e79475a2bccc0c7186da577b61a38">Arena</a> &gt; *&#160;</td>
          <td class="paramname"><em>shm_session</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>To be called after being done mutating underlying structured data, increments owner-process count by 1 via <code>shm_session-&gt;lend_object()</code>; and populates a capnp-<code>struct</code> field, saving the encoding of the outer SHM handle to the serialization-segment data structure <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#ac2e22abe941240ffa765bff7d288ce1e" title="The outer data structured stored in SHM representing the entire list of capnp-requested segments Segm...">Segments_in_shm</a> into that field. </p>
<p >You may call this method more than once per <code>*this</code>. In particular this is necessary if sending the SHM-handle via IPC more than once &ndash; even if one has already sent it to that same process (or another). Even if the bits populated into <code>*capnp_root</code> shall always be the same for a given <code>*this</code>, it is nevertheless required to call it repeatedly when sharing repeatedly.</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000024">Todo:</a></b></dt><dd>Would be nice to provide a more-general counterpart to existing <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html#a4a613441302d5735d686adb7d6d92fb0" title="To be called after being done mutating underlying structured data, increments owner-process count by ...">Capnp_message_builder::lend()</a> (in addition to that one which outputs into a capnp structure), such as one that outputs a mere <code>Blob</code>. The existing one is suitable for the main use-case which is internally by <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Builder.html" title="Implements Struct_builder concept with maximal zero-copy perf by (1) storing the actual user-schema-c...">shm::Builder</a>; but <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html" title="A capnp::MessageBuilder used by shm::Builder: similar to a MallocMessageBuilder with the GROW_HEURIST...">Capnp_message_builder</a> is also usable as a <code>capnp::MessageBuilder</code> directly. If a user were to indeed leverage it in that latter capacity, they may want to transmit/store the SHM-handle some other way. Note that as of this writing the direct-use-by-general-user-as-<code>MessageBuilder</code> use-case is supported "just
because" it can be; nothing in particular needed it.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">capnp_root</td><td>The target SHM-handle serialization root to populate as noted above. </td></tr>
    <tr><td class="paramname">shm_session</td><td><code>Shm_session</code> to the opposing recipient to which we are lending. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="ac4969b49016844f884240b81ee1ab180" name="ac4969b49016844f884240b81ee1ab180"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4969b49016844f884240b81ee1ab180">&#9670;&nbsp;</a></span>operator&lt;&lt;()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Shm_arena &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::ostream &amp; operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">std::ostream &amp;&#160;</td>
          <td class="paramname"><em>os</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html">Capnp_message_builder</a>&lt; Shm_arena &gt; &amp;&#160;</td>
          <td class="paramname"><em>val</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Prints string representation of the given <code><a class="el" href="classipc_1_1transport_1_1struc_1_1shm_1_1Capnp__message__builder.html" title="A capnp::MessageBuilder used by shm::Builder: similar to a MallocMessageBuilder with the GROW_HEURIST...">Capnp_message_builder</a></code> to the given <code>ostream</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">os</td><td>Stream to which to write. </td></tr>
    <tr><td class="paramname">val</td><td>Object to serialize. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>os</code>. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>transport/struc/shm/<a class="el" href="capnp__msg__builder_8hpp.html">capnp_msg_builder.hpp</a></li>
<li>transport/struc/shm/<a class="el" href="transport_2struc_2shm_2shm__fwd_8hpp.html">shm_fwd.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu May 2 2024 23:56:36 for Flow-IPC by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
